Working with files

This chapter discusses the HoTMetaL commands for creating, opening, closing, and saving files, previewing the current document with a browser, and checking document correctness.

Creating a new file

Choose New... from the File menu (or click on the NEWICON toolbar button) to create a new file. HoTMetaL will open the `default template' file chosen with the Preferences... command.

Opening a file

Choose Open... from the File menu (or click on the OPENICON toolbar button) to open an existing file. The default file extension in the Open dialog box is .html. When you open a file, HoTMetaL converts the `raw HTML' into a graphical format in which the tags are replaced by tag icons, and HoTMetaL's graphical editing features are available. You cannot open a file that's already open.

The names of the last four files that you opened with HoTMetaL are added to the File menu. You can open a file (or make it the current file, if it's already open) by choosing it from this menu.

Choosing the Documents... command in the File menu gives you a dialog box that contains a list of the open files. To make a particular file the current file, click once on the filename. Leaving this dialog box open on the screen also provides quick access to the New and Open... commands. To choose one of these commands, click on the appropriate button.

Error checking

If an HTML file contains markup errors, HoTMetaL will try to rearrange the markup so that the file can be opened and displayed in graphical format. In these situations HoTMetaL will usually succeed in creating a valid file, although you may have to adjust some of the markup manually. If HoTMetaL cannot turn on rules checking it will give a warning message informing you of the problem, and the insertion point will move to the location of the error.

In some cases rules checking can be turned on but the file will not validate. This normally means that some element is missing a required sub-element: for example, an OL might not have any LI elements in it. HoTMetaL does not inform you automatically if the file will not validate: you can check if the file validates by choosing Validate Document from the Special menu.

If the HTML errors are so serious that the file cannot be opened in graphical format (for example, if the file contains a non-HTML element), HoTMetaL will open it as a text file. This gives you the opportunity to correct the errors manually. Although the graphical editing features of HoTMetaL are not available if you're editing a text file, you can still use Validate Document to locate errors. When you've corrected the errors, choose Interpret Document from the Special menu. This performs the equivalent of Open... on the text document.

Using templates

Templates are pre-defined structures for documents. They are used as forms or document outlines that you can enter text into without necessarily having to insert any of the markup yourself.

Opening a template

To open a template, click on the Open Template... command. This brings up a file selection dialog box labeled Open Template, which displays the files and directories in the templates directory. The file aareadme.html in this directory gives you an index of templates. Each file corresponds to a template: to open a template, just select it from this dialog box as you would any other file. The document name in the document window's title bar will be in the form Document1, Document2, and so forth.

When the template file is opened you can enter text or elements into it, and later save the file.

Creating your own templates

A number of templates are shipped with HoTMetaL, but you can work with templates that were created at your own site.

To create a template file with HoTMetaL, you should just create a file as you normally would and save it in the templates directory.

Saving files

The Save command (or the SAVEICON toolbar button) saves the current file (that is, the file that is open in the HoTMetaL document window) to the disk. Files are always saved in HTML format.

Note: A `document type declaration' (DOCTYPE) will be saved at the top of the file.

If you have rules checking turned on, the file will be validated when you save it, and you will be warned if there are errors and asked if you still want to save. If you do, the saved file will be invalid and HoTMetaL may have trouble opening it in the future.

To save the file under a new name, choose Save As... from the File menu.

Save options

Using the Preferences... command in the Special menu, you can specify that HoTMetaL should:

See the section Preferences in the Getting started chapter for more information.

Previewing your file in a browser

If you want to see what your document will look like in a web browser, choose Preview... in the File menu.

If your document hasn't been saved, you will be given the choice of saving it and previewing, saving it as a temporary file and previewing, or cancelling the operation.

If you want to add a browser to the list:

To delete a browser from the list:

Previewing a document with this command is the same as saving the file with HoTMetaL, launching the browser independently of HoTMetaL, and then opening the file with the browser.

Closing a file

The Close command in the File menu closes the current file. If the file has had changes made to it since it was last saved, you will be prompted to save the changes before closing it.

Exiting

Exit quits HoTMetaL. If an open file has been changed since the last time it was saved, you will be prompted to save the file before exiting.